package com.lzw.okgoutils.http;

import java.io.Serializable;


public class ErrorResponse implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * The external content in HTTP head, and the static variable is not serializable
	 */
	public static final String KEY_HTTP_HEAD = "ErrorForMobile";
	public static final String VALUE_ERROR_CAUGHT = "1";
			
	/**
	 * The session error codes means the client have to Re-verified itself.
	 */
	public final static String[] SESSION_ERROR = {
		
		SessionError.LOGIN_ELSEWHERE
	};
	
	/**
	 * The error message for mobile to show
	 */
	private String message = null;
	private String errorCode = null;
	

	public String getMessage() {
		return message == null ? "请求发生异常，且服务器返回错误信息不可用。" : message;
	}
	
	public String getErrorCode(){
		return errorCode;
	}
	
	public static final class SessionError {
		 /**
		  * 301: user name or password is incorrect
		  */
		public static final String ACCOUNT_ERROR = "301";
		
		/**
		 * 302:The account login elsewhere
		 */
		public static final String LOGIN_ELSEWHERE = "302"; 
	}

	public static final String ERROR_MSG_ACCOUNT = "用户名或密码不正确";
	public static final String ERROR_MSG_LOGIN_ELSEWHERE = "账号失效或在别处登陆";
}
